{% extends "../main.html" %}

{% block title %}{{ _("Password Reset") }}{% end %}

{% block header %}
<link href="/static/css/pages/public/login.css" rel="stylesheet">
<script src="/static/js/pages/public/reset.js"></script>
{% from tornado.options import options %}
{% end %}

{% block content %}
<div class="container">
    <form class="form-signin" action="/reset/token" method="post">
    {% raw xsrf_form_html() %}
        <h3 class="form-signin-heading">
            <i class="fa fa-lock"></i>
            {{ _("Password Reset") }}
        </h3>
        {% if errors is not None and len(errors) != 0 %}
            {% for error in errors %}
                <div class="alert alert-error" >
                    <a class="close" data-dismiss="alert" href="#">&times;</a>
                    <h4 class="alert-heading">{{ _("Error") }}</h4>
                    {{ error }}
                </div>
            {% end %}
        {% end %}
        {% if info is not None and len(info) != 0 %}
            {% for item in info %}
                <div class="alert alert-info" >
                    <a class="close" data-dismiss="alert" href="#">&times;</a>
                    <h4 class="alert-heading">{{ _("Information") }}</h4>
                    {{ item }}
                </div>
                &nbsp;&nbsp;<a href="/login">{{ _("Click here to login") }} &raquo;</a>
                <br />
            {% end %}
        {% elif errors is None %}  
            <div>
                <input type="hidden" name="uuid" value="{{uuid}}" />
                <input type="hidden" name="token" value="{{token}}" />
                <input class="input-block-level" required id="pass1" name="pass1" minlength="{{ options.min_user_password_length }}"  placeholder="{{ _('Password') }}" type="password"
                    autocomplete="off"
                    rel="popover"
                    data-original-title="{{_('Password')}}"
                    data-content="{{_('Enter a complex password of')}} {{ options.min_user_password_length }}+ {{_('Characters')}}" />
                <input class="input-block-level" required id="pass2" name="pass2" minlength="{{ options.min_user_password_length }}"  placeholder="{{ _('Confirm Password') }}" type="password"
                    autocomplete="off"
                    rel="popover"
                    data-original-title="{{_('Confirm Password')}}"
                    data-content="{{_('Enter the same password as before')}}" />
            </div>
            <button class="btn btn-primary" type="submit">
                <i class="fa fa-sign-in"></i>
                {{ _("Reset") }}
            </button>
        {% end %}
    </form>
</div> <!-- /container -->
<br />
{% end %}